#!/bin/sh

addgroup -S lxd 2>/dev/null

for file in /etc/subuid /etc/subgid; do
	if ! $(grep -q root "$file"); then
		echo "root:1000000:1000000000" >> "$file"
	else
		sed -i 's/^root.*/root:1000000:1000000000/' "$file"
	fi
done

exit 0
